$def with (page)

$ advanced = (
$    ('title', _("Title"), ""),
$    ('author', _("Author"), ""),
$    ('isbn', "ISBN", ""),
$    ('subject', _("Subject"), ""),
$    ('place', _("Place"), ""),
$    ('person', _("Person"), ""),
$    ('publisher', _("Publisher"), ""),
$ )

    <h2 class="shift">Site Search</h2>
    <div class="siteSearch" id="headerSearch">
        <form method="get" action="/search" class="siteSearch">
            <fieldset class="home">
            <legend>Site Search</legend>
            <label for="qtop" class="hidden">Keyword</label>
            <input type="text" placeholder="Search books" name="q" id="qtop" />
            <input type="submit" value="$_('Search')"/>

            <div class="searchPlacement">
                <div class="searchFilter">
                    <div class="searchOpener">
                        <a href="javascript:;" id="searchHead">$_("Advanced")</a>
                    </div>
                    <div class="searchCheckboxes">
                        <ul>
                            <li><input name="has_fulltext" type="checkbox" value="true" checked="true" id="ftokenstop" />
                                <label for="ftokenstop">$_("Only eBooks")</label></li>
                            <li><input name="search-fulltext" type="checkbox" value="true" id="search-fulltext" />
                                <label for="search-fulltext">$_("Search eBook text")</label></li>
                        </ul>
                    </div>
                </div>
            </div>
            </fieldset>
            <div id="topOptions" class="searchOptions hidden">
            <fieldset class="home">
                <legend>Advanced Search</legend>
            $for name, label, placeholder in advanced:
                <div class="formElement">
                <label for="qtop-$name">$label</label><br/>
                <input type="text" name="$name" id="qtop-$name" placeholder="$placeholder" size="35"/>
                </div>
            </fieldset>
            <div class="searchPlus">
                <a href="/search/inside">Full Text Search</a>?
            </div>
            </div>
        </form>
    </div>


    <div id="headerTools">
        <div id="headerLogin">
        $if ctx.user:
            <div class="hidden">
                <form name='logout' action="$homepath()/account/logout" method="post"></form>
            </div>
            <div id="headerUser">
                <a href="javascript:;" id="userToggle" title="Open Menu"><span class="label">$ctx.user.displayname</span><span class="arrow">&nbsp;&#9660;</span></a>
                <div id="headerUserOpen">
                    <a href="$ctx.user.key">$_("Your Profile")</a>
                    <a href="$homepath()/account/loans">$_("Loans")</a>
                    <a href="$ctx.user.key/lists">$_("Lists")</a>
                    <a href="$homepath()/account">$_("Settings")</a>
                    <a href="#" onclick="document.forms['logout'].submit()">Log out</a>
                </div>
            </div>
        $else:
            <a href="/account/login" class="white">$_("Log in")</a>
            /
            <a href="/account/create">$_("Sign Up")</a>
        </div>
    </div>
